﻿using CPPEI.Net;
using CPPEI.ShareScreen.Event.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.ShareScreen.ServerProxy.ResponseHandler
{
    public class RDConnectToClientHandler : BaseResponseHandler<Contract.RespRDConnectToClientData>
    {
        protected override void OnHandle(NetPackage response, Contract.RespRDConnectToClientData responseData)
        {
            if (responseData.IsTargetClient)
            {
                UIEnterUploadRDModeEvent @event = new UIEnterUploadRDModeEvent();
                UIEventBus.PublishAsync(@event);
            }
            else
            {
                UIRDConnectToClientEvent @event = new UIRDConnectToClientEvent();
                @event.RoomID = responseData.RoomID;
                @event.TargetClientID = responseData.TargetClientID;
                UIEventBus.PublishAsync(@event);
            }
        }
    }
}
